Skip to content

Add rulemaking document sorting logic and tests#6541

Open
tmpayton wants to merge 1 commit intodevelopfrom
feature/6524-add-rulemaking-document-sort
Open

Add rulemaking document sorting logic and tests#6541
tmpayton wants to merge 1 commit intodevelopfrom
feature/6524-add-rulemaking-document-sort

Conversation

@tmpayton
Copy link
Copy Markdown
Contributor

Summary (required)

This PR adds the front end sorting logic to the api.

Sorting rules:

  • No tier documents:

    • Sort by doc date in descending order (no changes needed)
  • Level 2 or 3 documents:

    • Sort by date ascending (no changes needed)
  • Level 1 documents:

    • Sort by date descending with tier precedence as tie breaker
    • If a document does not have a date use the last sub-doc’s date otherwise use today

Required reviewers 1 - 2 devs

Impacted areas of the application

General components of the application that this PR will affect:

  • rulemaking endpoint

How to test

  • Compare API results to cms on dev. The document order should match.

Test URLS:

https://fec-dev-api.app.cloud.gov/v1/rulemaking/search/?rm_no=2005-02
https://dev.fec.gov/legal/rulemakings/2005-02/?doc_id=1229

https://fec-dev-api.app.cloud.gov/v1/rulemaking/search/?rm_no=2006-01
https://dev.fec.gov/legal/rulemakings/2006-01/?doc_id=7749

https://fec-dev-api.app.cloud.gov/v1/rulemaking/search/?rm_no=2014-01
https://dev.fec.gov/legal/rulemakings/2014-01/?doc_id=305653

https://fec-dev-api.app.cloud.gov/v1/rulemaking/search/?rm_no=2024-01
https://dev.fec.gov/legal/rulemakings/2024-01/?doc_id=425540

https://fec-dev-api.app.cloud.gov/v1/rulemaking/search/?q=%22REG%202013-04%22&q_proximity=Weintraub%20voting%20affirmatively&q_proximity=Commissioners%20Goodman&max_gaps=3&doc_category_id=1

https://fec-dev-api.app.cloud.gov/v1/rulemaking/search/?rm_no=2011-02&q=%22postal%20service%20address%20of%20a%20commenter%22

Copy link
Copy Markdown
Contributor

@pkfec pkfec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tmpayton for refining the the doc order logic and adding it to the API. Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Correct document sorting logic in the rulemakings documents list

2 participants